package jwdt.xadmin.work.bean;

import java.util.List;
import java.util.Map;

import com.ezerg.db.Jdb;
import com.ezerg.db.annotation.Column;
import com.ezerg.db.annotation.Table;

@Table(name="t_email", keys={"emailid"}, comment="内部邮件")
public class TEmail implements java.io.Serializable {

	private static final long serialVersionUID = 1L;

	@Column(value="emailid", comment="ID")
	private Integer emailid;
	
	@Column(value="userid", comment="ID")
	private Integer userid;
	
	@Column(value="sender", comment="发件人")
	private String sender;
	
	@Column(value="receiver", comment="收件人")
	private String receiver;
	
	@Column(value="receiverids", comment="收件人")
	private String receiverids;
	
	@Column(value="cc", comment="抄送")
	private String cc;
	
	@Column(value="title", comment="标题")
	private String title;
	
	@Column(value="content", comment="内容")
	private String content;
	
	@Column(value="dt", comment="时间")
	private String dt;
	
	@Column(value="zt", comment="状态")
	private Integer zt;

	public Integer getEmailid() {
		return emailid;
	}

	public void setEmailid(Integer emailid) {
		this.emailid = emailid;
	}

	public String getSender() {
		return sender;
	}

	public void setSender(String sender) {
		this.sender = sender;
	}

	public String getReceiver() {
		return receiver;
	}

	public void setReceiver(String receiver) {
		this.receiver = receiver;
	}

	public Integer getUserid() {
		return userid;
	}

	public void setUserid(Integer userid) {
		this.userid = userid;
	}

	public String getReceiverids() {
		return receiverids;
	}

	public void setReceiverids(String receiverids) {
		this.receiverids = receiverids;
	}

	public String getCc() {
		return cc;
	}

	public void setCc(String cc) {
		this.cc = cc;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getDt() {
		return dt;
	}

	public void setDt(String dt) {
		this.dt = dt;
	}

	public Integer getZt() {
		return zt;
	}

	public void setZt(Integer zt) {
		this.zt = zt;
	}
	public String getSenderId() {
		@SuppressWarnings("unchecked")
		List<Map<String, String>> list = Jdb.get().query("select userid from t_useremail where zt=2 and emailid = "+this.emailid);
		return list==null?"":list.get(0).get("userid");
	}
}
